-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move newline to inside the DisableAutoGenTag block #2030
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems fine. Is this more stylistic than anything? I'm surprised there are tools that have an opinion on markdown formatting. Or is it more that some version control tools don't want extra newlines at the end of files?
I'd like to understand more on why this is needed.
There are tools that care about whitespace regardless of the file type, as stated in the original issue pre-commit has a The fix ensures the generated files only have a single return at the end of the file, it does not remove all of them. If this is deemed not needed feel free to close it or let me know and I can. |
It would be nice to add a little test to keep the output correct after this change. |
Added a new assertion to the tests
After fix the test passes. All other tests already pass as they don't have the double line break. |
@@ -40,6 +42,7 @@ func TestGenMdDoc(t *testing.T) { | |||
checkStringContains(t, output, echoSubCmd.Short) | |||
checkStringOmits(t, output, deprecatedCmd.Short) | |||
checkStringContains(t, output, "Options inherited from parent commands") | |||
checkStringOmitsSuffix(t, output, doubleLineBreak) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is nice, but don't we want the more general check, that the output always ends with a single newline?
Fixes #2029